<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title>Dodawanie Nowego Prowadzącego</title>
</head>
<body>
<div class="nav2">
    <span class="menuButton"><g:link class="list" action="list">Lista Prowadzących</g:link></span>
</div>
<div class="body">
    <h1>Dodawanie Nowego Prowadzącego:</h1>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${teacher}">
        <div class="errors">
            <g:renderErrors bean="${teacher}" as="list"/>
        </div>
    </g:hasErrors>
    <g:form action="save" method="post">
        <div class="dialog">
            <table class="main">
                <tbody>
                    <tr>
                        <td>
                            <table>
                                <tbody>

                                    <tr class="prop">
                                        <td>
                                            <h2>Dane główne:</h2>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="imie">Imie:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'imie', 'errors')}">
                                            <input type="text" id="imie" name="imie" value="${fieldValue(bean: teacher, field: 'imie')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="nazwisko">Nazwisko:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'nazwisko', 'errors')}">
                                            <input type="text" id="nazwisko" name="nazwisko" value="${fieldValue(bean: teacher, field: 'nazwisko')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="tytulNaukowy">Tytul Naukowy:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'tytulNaukowy', 'errors')}">
                                            <input type="text" id="tytulNaukowy" name="tytulNaukowy" value="${fieldValue(bean: teacher, field: 'tytulNaukowy')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="email">Email:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'email', 'errors')}">
                                            <input type="text" id="email" name="email" value="${fieldValue(bean: teacher, field: 'email')}"/>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                            <br>
                            <table>
                                <tbody>

                                    <tr class="prop">
                                        <td>
                                            <h2>Dane konta:</h2>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="username">Username:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'username', 'errors')}">
                                            <input type="text" id="username" name="username" value="${fieldValue(bean: teacher, field: 'username')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="userRealName">User Real Name:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'userRealName', 'errors')}">
                                            <input type="text" id="userRealName" name="userRealName" value="${fieldValue(bean: teacher, field: 'userRealName')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="passwd">Passwd:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'passwd', 'errors')}">
                                            <input type="text" id="passwd" name="passwd" value="${fieldValue(bean: teacher, field: 'passwd')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="pass">Pass:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'pass', 'errors')}">
                                            <input type="text" name="pass" id="pass" value="${fieldValue(bean: teacher, field: 'pass')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="enabled">Enabled:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'enabled', 'errors')}">
                                            <g:checkBox name="enabled" value="${teacher?.enabled}"></g:checkBox>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="description">Description:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'description', 'errors')}">
                                            <input type="text" id="description" name="description" value="${fieldValue(bean: teacher, field: 'description')}"/>
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label for="emailShow">Email Show:</label>
                                        </td>
                                        <td valign="top" class="value ${hasErrors(bean: teacher, field: 'emailShow', 'errors')}">
                                            <g:checkBox name="emailShow" value="${teacher?.emailShow}"></g:checkBox>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <span class="button"><input class="icon-button-ok" type="submit" action="create" value="Zapisz"/></span>
        <span class="button"><g:actionSubmit class="icon-button-cancel" action="list" value="Anuluj"/></span>
    </g:form>
</div>
</body>
</html>
